/*
 * Signature7.java Created on Jan 13, 2008 by M.C.Boulahiya
 */
package model;

/**
 * @author M.C.Boulahiya
 *
 */
public class Signature7 {
	public double[] nuplet;

	public Signature7() {
		this.nuplet = new double[7];
	}

	public String toString() {
		String str = this.nuplet[0] + " " + this.nuplet[1] + " " + this.nuplet[2];
		str += " " + this.nuplet[3] + " " + this.nuplet[4] + " " + this.nuplet[5];
		str += " " + this.nuplet[6] + "\n";    
		return str;
	}

	public boolean equals(Object obj) {// TODO epsilonEqual ?
		Signature7 s = (Signature7)obj;
		double dist = (this.nuplet[0] - s.nuplet[0]) * (this.nuplet[0] - s.nuplet[0]);
		dist += (this.nuplet[1] - s.nuplet[1]) * (this.nuplet[1] - s.nuplet[1]);
		dist += (this.nuplet[2] - s.nuplet[2]) * (this.nuplet[2] - s.nuplet[2]);
		dist += (this.nuplet[3] - s.nuplet[3]) * (this.nuplet[3] - s.nuplet[3]);
		dist += (this.nuplet[4] - s.nuplet[4]) * (this.nuplet[4] - s.nuplet[4]);
		dist += (this.nuplet[5] - s.nuplet[5]) * (this.nuplet[5] - s.nuplet[5]);
		dist += (this.nuplet[6] - s.nuplet[6]) * (this.nuplet[6] - s.nuplet[6]);
		dist = Math.sqrt(dist);
		//System.out.println(dist);
		return (dist < 2);
	}
	
}// End of class Signature7

// End of file Signature7.java